package com.demo.rocketmq.message;

import com.demo.rocketmq.domain.User;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Service;

/**
 *
 * @author
 * @since
 */
@Slf4j
@Service
@RocketMQMessageListener(nameServer = "${demo.rocketmq.myNameServer}", topic = "${demo.rocketmq.topic.user}", consumerGroup = "user_consumer")
public class UserConsumer implements RocketMQListener<User> {
  @Override
  public void onMessage(User user) {
    log.info("UserConsumer 接收到 rocketmq 消息,内容:{}", user);
  }
}
